package com.sjlh.centurylianhua.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sjlh.centurylianhua.entity.PurchaseLogInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface PurchaseLogInfoMapper extends BaseMapper<PurchaseLogInfo> {

    /**
     *查询内容：
     * purchase_log_info表的所有，
     * product 表的 name 起别名为 productName 以便自动赋值 PurchaseLogInfo 类中的 productName 属性
     * ${ew.customSqlSegment} 传递wrapper条件的固定写法
     * */
    @Select("select purchase_log_info.*, product.name productName from purchase_log_info, product"
            +" ${ew.customSqlSegment} ")
    List<PurchaseLogInfo> getInfo(@Param("ew") QueryWrapper<PurchaseLogInfo> wrapper);
}
